﻿'----------------------------------------------
'   
'   Kernel Info:---------------------------
'   Developer:              Joshua Teeter
'   Genesis:                09-02-08
'   Last Update:            09-06-26
'   Origional Version:      0.0.0.0
'   Current Version:        0.0.0.2
'   ---------------------------------------
'   
'   
'   If you modify this code please leave your name in the modified by list seperated by a comma. 
'   Changes are to be denoted in the following manner:
'                                                       * New
'                                                       ^ Updated
'                                                       - Removed
'                                                       + Added Functionality
'                                                       ! Bug unresolved
'                                                       / Bug resolved
'                                                       % Modified but not changed in a noticeable way in terms of functionality
'  
'  Please use the following as a template and copy and paste as a new comment for each modification.
'   
'   Modification Info:---------------------
'   Class Name:             About.vb
'   Modified by:            NULL
'   Last Update:            NULL
'   Current Version:        #.#.#.#
'   Changes:                 NULL
'   ---------------------------------------
'   Modification Info:---------------------
'   Class Name:             About.vb
'   Modified by:            Joshua Teeter
'   Last Update:            09-06-04
'   Current Version:        0.0.0.2
'   Changes:                * Added skin settings
'   ---------------------------------------
'
'

Public NotInheritable Class About

    Private Sub skin()

        Dim themeColors As Theme = frmMain._GetSkinColours
        Dim buttons As New List(Of Button)
        Dim labels As New List(Of Label)
        Dim textboxes As New List(Of TextBox)

        With buttons
            .Add(btnOk)
        End With

        With labels
            .Add(LabelVersion)
            .Add(LabelProductName)
            .Add(LabelCompanyName)
            .Add(LabelCopyright)
        End With

        With textboxes
            .Add(TextBoxDescription)
        End With

        For Each btn As Button In buttons

            With btn

                .BackColor = Color.FromArgb(themeColors._colours("btnBRed"), _
                                             themeColors._colours("btnBGre"), _
                                             themeColors._colours("btnBBlu"))

                .FlatAppearance.MouseOverBackColor = Color.FromArgb(themeColors._colours("btnMOBRed"), _
                                     themeColors._colours("btnMOBGre"), _
                                     themeColors._colours("btnMOBBlu"))

                .FlatAppearance.MouseDownBackColor = Color.FromArgb(themeColors._colours("btnMDBRed"), _
                                     themeColors._colours("btnMDBGre"), _
                                     themeColors._colours("btnMDBBlu"))

                .FlatAppearance.BorderColor = Color.FromArgb(themeColors._colours("btnMOBRed"), _
                                                             themeColors._colours("btnMOBGre"), _
                                                             themeColors._colours("btnMOBBlu"))

                .ForeColor = Color.FromArgb(themeColors._colours("btnFRed"), _
                                             themeColors._colours("btnFGre"), _
                                             themeColors._colours("btnFBlu"))

                .Refresh()

            End With
            GC.Collect()
        Next

        For Each lbl As Label In labels

            With lbl

                .ForeColor = Color.FromArgb(themeColors._colours("lblFRed"), _
                                             themeColors._colours("lblFGre"), _
                                             themeColors._colours("lblFBlu"))

                .BackColor = Color.FromArgb(themeColors._colours("lblBRed"), _
                                             themeColors._colours("lblBGre"), _
                                             themeColors._colours("lblBBlu"))

                .Refresh()

            End With

            GC.Collect()

        Next


        For Each txt As TextBox In textboxes

            With txt

                .BackColor = Color.FromArgb(themeColors._colours("lbBRed"), _
                                             themeColors._colours("lbBGre"), _
                                             themeColors._colours("lbBBlu"))

                .ForeColor = Color.FromArgb(themeColors._colours("lbFRed"), _
                                             themeColors._colours("lbFGre"), _
                                             themeColors._colours("lbFBlu"))

                .Refresh()
            End With
            GC.Collect()
        Next

        With Me
            .BackColor = Color.FromArgb(themeColors._colours("frmBRed"), _
                                             themeColors._colours("frmBGre"), _
                                             themeColors._colours("frmBBlu"))
            .ForeColor = Color.FromArgb(themeColors._colours("frmFRed"), _
                                             themeColors._colours("frmFGre"), _
                                             themeColors._colours("frmFBlu"))
            .Opacity = CDbl(themeColors._colours("Transparent")) / 100
            .Refresh()
        End With


        GC.Collect()

    End Sub

    Private Sub position(ByVal pos As String)

        If pos = "br" Then
            Dim x As Integer = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - Me.Width
            Dim y As Integer = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - Me.Height

            Me.Location = New Point(x, y)


        ElseIf pos = "bl" Then
            Dim x As Integer = My.Computer.Screen.Bounds.Width - System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width
            Dim y As Integer = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height - Me.Height

            Me.Location = New Point(x, y)


        Else
            Dim x As Integer = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - Me.Width
            Dim y As Integer = My.Computer.Screen.Bounds.Height - System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height

            Me.Location = New Point(x, y)

        End If
        GC.Collect()
    End Sub

    Private Sub About_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Set the title of the form.
        Dim ApplicationTitle As String
        If My.Application.Info.Title <> "" Then
            ApplicationTitle = My.Application.Info.Title
        Else
            ApplicationTitle = System.IO.Path.GetFileNameWithoutExtension(My.Application.Info.AssemblyName)
        End If
        Me.Text = String.Format("About {0}", ApplicationTitle)
        ' Initialize all of the text displayed on the About Box.
        ' TODO: Customize the application's assembly information in the "Application" pane of the project 
        '    properties dialog (under the "Project" menu).
        Me.LabelProductName.Text = My.Application.Info.ProductName
        Me.LabelVersion.Text = String.Format("Version {0}", My.Application.Info.Version.ToString)
        Me.LabelCopyright.Text = My.Application.Info.Copyright
        Me.LabelCompanyName.Text = My.Application.Info.CompanyName
        Me.TextBoxDescription.Text = My.Application.Info.Description
        Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        position(My.Settings.PositionRealitive)
        skin()
    End Sub

    Private Sub frmClick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
    Handles Me.Click, TableLayoutPanel.Click

        Me.Close()
        Me.Dispose()
        frmMain.Show()
        MemoryManagement.FlushMemory()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOk.Click, LabelCompanyName.Click, LabelCopyright.Click, LabelProductName.Click, _
    LabelVersion.Click
        Me.Close()
        Me.Dispose()
        frmMain.Show()
        MemoryManagement.FlushMemory()
    End Sub

    Private Sub TextBoxDescription_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxDescription.TextChanged
        If My.Settings.Egg = 3 Or My.Settings.Egg <> 0 Then

            If TextBoxDescription.TextLength > 10 Then
                If TextBoxDescription.Text.Contains("FiShDaNcE") Then
                    Try
                        System.Diagnostics.Process.Start("firefox.exe", "http://www.youtube.com/watch?v=i9SSOWORzw4")
                        TextBoxDescription.Text = My.Application.Info.Description
                    Catch
                        Try
                            System.Diagnostics.Process.Start("http://www.youtube.com/watch?v=i9SSOWORzw4")
                            TextBoxDescription.Text = My.Application.Info.Description
                        Catch
                            TextBoxDescription.Text = "GO HERE --> http://www.youtube.com/watch?v=i9SSOWORzw4"
                        End Try

                    End Try

                End If

            End If

            If TextBoxDescription.TextLength = 10 Then
                If TextBoxDescription.Text.ToLower.Contains("O Fortuna".ToLower) Then
                    Try
                        System.Diagnostics.Process.Start("firefox.exe", "http://www.youtube.com/watch?v=CPyAli2xrog")
                        TextBoxDescription.Text = My.Application.Info.Description
                    Catch
                        Try
                            System.Diagnostics.Process.Start("http://www.youtube.com/watch?v=CPyAli2xrog")
                            TextBoxDescription.Text = My.Application.Info.Description
                        Catch
                            TextBoxDescription.Text = "GO HERE --> http://www.youtube.com/watch?v=CPyAli2xrog"
                        End Try

                    End Try

                End If

            End If

            If TextBoxDescription.TextLength = 4 Then
                If TextBoxDescription.Text.ToLower.Contains("Dana".ToLower) Then
                    Try
                        System.Diagnostics.Process.Start("firefox.exe", "http://www.youtube.com/watch?v=teMlv3ripSM")
                        TextBoxDescription.Text = My.Application.Info.Description
                    Catch
                        Try
                            System.Diagnostics.Process.Start("http://www.youtube.com/watch?v=teMlv3ripSM")
                            TextBoxDescription.Text = My.Application.Info.Description
                        Catch
                            TextBoxDescription.Text = "GO HERE --> http://www.youtube.com/watch?v=teMlv3ripSM"
                        End Try

                    End Try

                End If

            End If

            If TextBoxDescription.TextLength = 3 Then
                If TextBoxDescription.Text.ToLower.Contains("Val".ToLower) Then
                    Try
                        System.Diagnostics.Process.Start("firefox.exe", "http://www.youtube.com/watch?v=JoKaErC6vmM")
                        TextBoxDescription.Text = My.Application.Info.Description
                    Catch
                        Try
                            System.Diagnostics.Process.Start("http://www.youtube.com/watch?v=JoKaErC6vmM")
                            TextBoxDescription.Text = My.Application.Info.Description
                        Catch
                            TextBoxDescription.Text = "GO HERE --> http://www.youtube.com/watch?v=JoKaErC6vmM"
                        End Try

                    End Try

                End If

            End If

            Me.TopMost = True

        End If
        ' For anyone who actually looks here, some of my favourite sites are above and below...
        'http://www.khaaan.com/
        'http://xkcd.com/149/
        'http://www.youtube.com/watch?v=JoKaErC6vmM
        'I will update this at some point.
        System.GC.Collect()
    End Sub
End Class
